package com.sjgs.gis.config;

import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

@NoArgsConstructor
@ConfigurationProperties(prefix = "geospark")
public class GeoSparkProperties {
    private boolean enabled = true;
    private String appName = "geospark";
    private String master = "local[*]";
    private String localDir = "/data/catalog";

    private Map<String, String> options = new HashMap<>();

    private final Hadoop hadoop=new Hadoop();

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getMaster() {
        return master;
    }

    public void setMaster(String master) {
        this.master = master;
    }

    public String getLocalDir() {
        return localDir;
    }

    public void setLocalDir(String localDir) {
        this.localDir = localDir;
    }

    public Map<String, String> getOptions() {
        return options;
    }

    public void setOptions(Map<String, String> options) {
        this.options = options;
    }

    public Hadoop getHadoop() {
        return hadoop;
    }

    @NoArgsConstructor
    public static class Hadoop {
        private String url = "hdfs://localhost:9009";

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }
}
